import request from '@/utils/request'

// 获取目录的数据
export function getdirectorys(params) {
  return request({
    url: '/directorys',
    method: 'get',
    params
  })
}
// 获取简单学科列表数据
export function easySubject() {
  return request({
    url: '/subjects/simple',
    method: 'get'
  })
}
// 目录添加
export function append(data) {
  return request({
    url: '/directorys',
    method: 'post',
    data
  })
}
// 修改目录状态
// 禁用
export function forbiddenState(id) {
  console.log(id)
  return request({
    url: `/directorys/${id}/${0}`,
    method: 'post'
  })
}
// 启用
export function enableState(id) {
  console.log(id)
  return request({
    url: `/directorys/${id}/${1}`,
    method: 'post'
  })
}
// 删除当前行数据的操作
export function deldirectorys(val) {
  console.log(val)
  return request({
    url: `/directorys/${val.subjectID}`,
    method: 'delete'
  })
}
// 目录修改
export function amends(data) {
  return request({
    url: `/directorys/${data.id}`,
    method: 'put',
    data
  })
}
